From: Prajna Sariputra Date: Thu, 1 Apr 2021 09:20:29 +0000 (+1100) Subject: status/power: Always show real percentage in battery label X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~47 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6ee2c4f74c09a6fe3d79beb70e052f31e049e3f5;p=gnome-shell.git status/power: Always show real percentage in battery label We currently display the percentage as "100%" if the battery state is "fully charged", but the actual capacity may be lower than that. Just show the real percentage, which is consistent with Settings. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3393 Part-of: --- diff --git a/js/ui/status/power.js b/js/ui/status/power.js index 0e8471fdf..304f68d47 100644 --- a/js/ui/status/power.js +++ b/js/ui/status/power.js @@ -134,11 +134,7 @@ class Indicator extends PanelMenu.SystemIndicator { this._item.icon.fallback_icon_name = fallbackIcon; // The icon label - let label; - if (this._proxy.State == UPower.DeviceState.FULLY_CHARGED) - label = _("%d\u2009%%").format(100); - else - label = _("%d\u2009%%").format(this._proxy.Percentage); + const label = _('%d\u2009%%').format(this._proxy.Percentage); this._percentageLabel.text = label; // The status label